package com.qfedu.controller;

import com.qfedu.common.JsonResult;
import com.qfedu.service.TradeService;
import com.qfedu.vo.VTradeInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

/**
 * @Author 刘浩
 * @Date 2020/8/19 10:30
 */
@Controller
@RequestMapping("/trade")
public class TradeController {
    @Autowired
    private TradeService tradeService;
    @RequestMapping("/list.do")
    @ResponseBody
    public JsonResult listTradeInfo(Date beginTime,Date endTime){
        List<VTradeInfo> list = tradeService.findAll(beginTime, endTime);
        JsonResult jsonResult = new JsonResult(1, list);
//        for (VTradeInfo vTradeInfo : list) {
//            System.out.println(vTradeInfo.getCreateTime());
//        }
        return jsonResult;
    }
}
